package com.tool_stdy.Proxy;

import java.lang.reflect.Proxy;

/**
 * Created by yan_li on 2016/1/31.
 */
public class Client {
    public static void main(String[] args) {
        UserDAO user  = new UserDAOImpl();

        UserProxyDAO proxyDAO = new UserProxyDAO<UserDAO>(user);
        UserDAO o =(UserDAO)Proxy.newProxyInstance(user.getClass().getClassLoader(), user.getClass().getInterfaces(), proxyDAO);
        System.out.println(o.delete(2));
    }
}
